package tianrun.ziguan.api.calculate.config.dto.request.common;

import tianrun.ziguan.api.calculate.config.entity.TCalAsset;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.Set;
import java.util.stream.Collectors;

public class DeleteBody {

    @NotBlank(message = "tableName 不能为空！")
    private String tableName;
    @NotEmpty(message = "ids 不能为空！")
    private Set<Long> ids;

    public DeleteBody() {
    }

    public DeleteBody(String tableName, Set<Long> ids) {
        this.tableName = tableName;
        this.ids = ids;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Set<Long> getIds() {
        return ids;
    }

    public void setIds(Set<Long> ids) {
        this.ids = ids;
    }

    public static DeleteBody of(Set<Long> ids,String tableName){
        DeleteBody deleteBody = new DeleteBody();
        deleteBody.setIds(ids);
        deleteBody.setTableName(tableName);
        return deleteBody;
    }

}
